package com.plusjun.gulimall.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.plusjun.common.utils.PageUtils;
import com.plusjun.gulimall.product.entity.CategoryEntity;
import com.plusjun.gulimall.product.vo.Catalog2VO;

import java.util.List;
import java.util.Map;

/**
 * 商品三级分类
 *
 * @author jiajiajun
 * @email ${email}
 * @date 2020-05-13 18:07:02
 */
public interface CategoryService extends IService<CategoryEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     *  组合成父子关系
     * @return
     */
    List<CategoryEntity> listWithTree();

    /**
     * 批量删除菜单
     * @param asList
     */
    void removeMenuByIds(List<Long> asList);

    /**
     *  找到catelogId的完整路径
     *  [父/子/孙]
     * @param catelogId
     * @return
     */
    Long[] findCatelogPath(Long catelogId);

    /**
     * 级联更新所有数据
     * @param category
     */
    void updateCascade(CategoryEntity category);

    /**
     *  查找到所有根级分类
     * @return
     */
    List<CategoryEntity> getLevel1Categorys();

    Map<String, List<Catalog2VO>> getCatelog2VO();
}

